package com.zb.vo;

import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/10/30 0030
 **/
@Data
@ApiModel("仓库对象")
public class StoreVo {

    @ApiModelProperty(value = "仓库ID，新增不必传，修改必传")
    private Long id;

    @Length(max = 60, message = "仓库编码长度限制 60 个字符")
    @ApiModelProperty(value = "仓库编码，不传则系统生成")
    private String storeNo;

    @NotBlank(message = "仓库名称不能为空")
    @Length(max = 50, message = "仓库名称长度限制 50 个字符")
    @ApiModelProperty(value = "仓库名称", required = true)
    private String name;

    @NotNull(message = "启用仓位项不能为空")
    @ApiModelProperty(value = "是否启用仓位：false-不启用，true-启用", required = true, example = "false")
    private Boolean enableStorePosition;

    @NotNull(message = "仓库类型不能为空")
    @ApiModelProperty(value = "仓库类型：false-内部仓库，true-外部仓库", required = true, example = "false")
    private Boolean outStore;

    @NotNull(message = "外部仓库类型不能为空")
    @ApiModelProperty(value = "外部仓库类型：1-服务商仓库，2-工程师仓库，当outStore=true时生效", example = "1")
    private Integer outStoreType;

    @ApiModelProperty(value = "关联ID，当is_out_store=1时生效，关联网点或工程师/网点人员ID", example = "0")
    private Long relationId;

    @NotNull(message = "允许负库存项不能为空")
    @ApiModelProperty(value = "是否允许负库存：false-不允许，true-允许", required = true, example = "false")
    private Boolean canNegativeStock;

    @NotBlank(message = "仓库联系人不能为空")
    @Length(max = 100, message = "仓仓库联系人长度限制 100 个字符")
    @ApiModelProperty(value = "仓库联系人", required = true)
    private String userName;

    @NotBlank(message = "联系人手机号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "联系人手机号格式错误")
    @ApiModelProperty(value = "联系人手机号", required = true)
    private String userPhone;

    @Length(max = 20, message = "其他联系方式长度限制 20 个字符")
    @ApiModelProperty(value = "其他联系方式")
    private String otherPhone;

    @NotNull(message = "仓库状态不能为空")
    @ApiModelProperty(value = "仓库状态：false-启用，true-禁用", required = true, example = "false")
    private Boolean status;

    @NotBlank(message = "仓库地址-省不能为空")
    @Length(max = 50, message = "仓库地址-省长度限制 50 个字符")
    @ApiModelProperty(value = "仓库地址-省", required = true)
    private String province;

    @NotBlank(message = "仓库地址-市不能为空")
    @Length(max = 50, message = "仓库地址-市长度限制 50 个字符")
    @ApiModelProperty(value = "仓库地址-市")
    private String city;

    @NotBlank(message = "仓库地址-县/区不能为空")
    @Length(max = 50, message = "仓库地址-县/区长度限制 50 个字符")
    @ApiModelProperty(value = "仓库地址-县/区")
    private String area;

    @Length(max = 50, message = "仓库地址-镇长度限制 50 个字符")
    @ApiModelProperty(value = "仓库地址-镇 ")
    private String town;

    @NotBlank(message = "仓库地址-详情地址不能为空")
    @Length(max = 200, message = "仓库地址-详情地址长度限制 200 个字符")
    @ApiModelProperty(value = "仓库地址-详情地址")
    private String address;

    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;

    @Valid
    @ApiModelProperty(value = "仓库仓位对象")
    private List<StorePositionVo> storePositionVos;

    @ApiModelProperty(value = "删除的仓库仓位ID集合")
    private List<Long> delStorePositionIds;


}
